public class DataTypeChange {
    public static void main(String[] args) {
        int num = 'a';
        //左边num变量是int类型
        //右边'a'是字面值是char类型
        //char  < int
        System.out.println("num = " + num);

        double d = 5;
        //左边d变量是double类型
        //右边5是字面量值是int类型
        //double > int
        System.out.println("d = " + d);

        System.out.println('a' + 5 + 5.6F + 9.6);//最终类型是double
        //                  97 + 5 + 5.6 + 9.6
        //117.19999847412109（有误差）

        byte b1 = 1;
        byte b2 = 2;
        //byte b3 = b1 + b2;//报错，因为 b1 + b2升级为int
        //int > byte

        short s1 = 1;
        short s2 = 2;
        //short s3 = s1 + s2;//报错，因为 s1 + s2升级为int

        char c1 = '0';
        char c2 = '1';
//        char c3 = c1 + c2;//报错，因为c1+c2升级为int


    }
}
